package main

import (
	"os"

	"gopkg.in/alecthomas/kingpin.v2"
)

var (
	Logger    = kingpin.Flag("log", "logger name").Default("p2k.log").Short('l').String()
	Conf      = kingpin.Flag("config", "yaml configure file").Default("config.yaml").Short('c').String()
	MetricMap = kingpin.Flag("map", "metric mapper file to map prometheus data to golia format").Default("mapper").Short('m').String()
	KafkaUrls = kingpin.Flag("kafka", "multiple kafka urls, seperated by ','").Default("127.0.0.1:9092").Short('k').String()
	Topic     = kingpin.Flag("topic", "kafka topic").Short('t').Default("test").String()
)

func main() {
	kingpin.Parse()
	c, err := NewController(*Logger, *Conf, *MetricMap)
	if err != nil {
		os.Exit(2)
	}
	c.Serve()
	defer c.Close()
}
